import 'package:flutter/material.dart';

@immutable class Rank {
    factory Rank.fromInt(int index) {
    assert(index>=1 && index<=13);
    return _singletons[index-1];
  }

  Rank._(this.value, this.label,);
  
  final int value;
  final String label;

  static final List<Rank> _singletons = [
    Rank._(1, 'A'),
    Rank._(2, '2'),
    Rank._(3, '3'),
    Rank._(4, '4'),
    Rank._(5, '5'),
    Rank._(6, '6'),
    Rank._(7, '7'),
    Rank._(8, '8'),
    Rank._(9, '9'),
    Rank._(10, '10'),
    Rank._(11, 'J'),
    Rank._(12, 'Q'),
    Rank._(13, 'K'),
  ];
}